﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using YGame.Base;
using YGame.Base.Part;

namespace YGame.GameLogic
{

	public class Actor : IActor
	{
		public IUser User { get; set; }
		public int ActorID { get; set; }
		public int MapID { get; set; }
		public Point Location { get; set; }
		public IPackagePart PackagePart { get; set; }

		public Actor()
		{
		}


		internal void Release()
		{

		}

		public void OnLogin()
		{
			if (Login != null)
			{
				Login(this, EventArgs.Empty);
			}
		}

		public void OnLogout()
		{
			if (Logout != null)
			{
				Logout(this, EventArgs.Empty);
			}
		}

		public event EventHandler Login;
		public event EventHandler Logout;
		public event EventHandler LocationChange;


		public void Load()
		{
			PackagePart.Load();
		}


		public void Save()
		{
			PackagePart.Save();
		}

	}
}
